package com.lianxian.xindong.login.mvp.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.hxb.library.base.BaseActivity;
import com.hxb.library.di.component.AppComponent;
import com.hxb.library.utils.HxbUtils;
import com.lianxian.xindong.commonsdk.utils.ImmersionBarUtil;
import com.lianxian.xindong.login.R;
import com.lianxian.xindong.login.R2;
import com.lianxian.xindong.login.di.component.DaggerOtherStepTwoComponent;
import com.lianxian.xindong.login.mvp.contract.OtherStepTwoContract;
import com.lianxian.xindong.login.mvp.presenter.OtherStepTwoPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.hxb.library.utils.Preconditions.checkNotNull;


/**
 * @作者：hexingbo
 * @时间：07/04/2023
 * @描述：
 */
public class OtherStepTwoActivity extends BaseActivity<OtherStepTwoPresenter> implements OtherStepTwoContract.View {

    @BindView(R2.id.rb_gril)
    RadioButton rbGril;
    @BindView(R2.id.rb_boy)
    RadioButton rbBoy;
    @BindView(R2.id.rg_sex)
    RadioGroup rgSex;
    @BindView(R2.id.rb_xqahjy)
    RadioButton rbXqahjy;
    @BindView(R2.id.rb_dszdx)
    RadioButton rbDszdx;
    @BindView(R2.id.rb_xxxq)
    RadioButton rbXxxq;
    @BindView(R2.id.rg_need)
    RadioGroup rgNeed;
    @BindView(R2.id.btn_submit)
    Button btnSubmit;

    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {
        DaggerOtherStepTwoComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .view(this)
                .build()
                .inject(this);
    }

    @Override
    public int initView(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_other_step_two; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {
        ImmersionBarUtil.setImmersionBar(this, true);
        btnSubmit.setText(R.string.login_next);
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void showMessage(@NonNull String message) {
        checkNotNull(message);
        HxbUtils.snackbarText(message);
    }

    @Override
    public void launchActivity(@NonNull Intent intent) {
        checkNotNull(intent);
        HxbUtils.startActivity(intent);
    }

    @Override
    public void killMyself() {
        finish();
    }

    @OnClick(R2.id.btn_submit)
    public void onViewClicked() {
        mPresenter.goOtherStepThree();
    }

    @Override
    public Context getContext() {
        return this;
    }
}
